import re
testStrings=["2x+5y","7y-3z"]
expressions=[r"2x\+5y|7y-3z",r"[0-9][a-zA-z0-9_].[0-9][yz]",r"\d\w-\d\w"]
for expression in expressions:
    for string in testStrings:
        
       if re.match(expression,string):
        print(expression,"matches",string)
testString1="800-123-4567"
testString2="617-123-4567"
testString3="email:\t joe_doe@deitel.com"

expression1=r"^\d{3}-\d{3}-\d{4}$"
expression2=r"\w+:\s+\w+@\w+.(com|org|net)"

if re.match(expression1,testString1):
   print(expression1,"matches",testString1)
if re.match(expression1,testString2):
   print(expression1,"matches",testString2)
if re.match(expression1,testString1):
   print(expression2,"matches",testString3)
